import { createRouter, createWebHistory, RouteRecordRaw } from "vue-router"
import Home from "../views/Home.vue"
import Parent from "../views/Parent.vue"

const routes: Array<RouteRecordRaw> = [
  {
    path: "/",
    name: "Home",
    component: Home,
  },
  {
    path: "/parent",
    name: "parent",
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: Parent,
  },
  {
    path: "/games/gobang",
    name: "gobang",
    component: () => import("@/views/games/gobang/index.vue"),
  },
  {
    path: "/games/sliding-blocks",
    name: "sliding-blocks",
    component: () => import("@/views/games/sliding-blocks/index.vue"),
  },
]

const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes,
})

export default router
